package com.yand.oratransmysql.thread;

import com.yand.oratransmysql.entity.DataBaseConvert;


/**
 * @author yanzz
 * 工厂模式通过类型创建不同的线程处理类
 */
public class DbConvertThreadFactory {


    /**
     * 创建处理线程类
     * @param type
     * @param dataBaseConvert
     * @return
     */
    public static Runnable createHandleThread(int type,DataBaseConvert dataBaseConvert){
        Runnable runnable = null;
        if(type == 1){
            runnable =  new DbConvertFileThread(dataBaseConvert);
        }else if(type == 2){
            runnable = new DbConvertHandleThread(dataBaseConvert);
        }
        return runnable;
    }

}
